/*
 * @Author: aggfb 714740235@qq.com
 * @Date: 2024-05-02 23:01:17
 * @LastEditors: aggfb 714740235@qq.com
 * @LastEditTime: 2024-05-09 23:02:24
 * @FilePath: \label_rack_control\firmware\bsp\bsp_flash.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef __BSP_FLASH_H__
#define __BSP_FLASH_H__

#include "apm32f10x_conf.h"


#define FLASH_PAGE_SIZE    ((uint16_t)0x400)            /* 页尺寸 */
#define BANK1_WRITE_START_ADDR  ((uint32_t)0x08008000)  /* 参数保存起始地址 32K开始 */
#define BANK1_WRITE_END_ADDR    ((uint32_t)FLASH_PAGE_SIZE + BANK1_WRITE_START_ADDR)  /* 参数保存结束地址 */

extern void bsp_flash_erase_page(uint32_t add);
extern void bsp_flash_write(uint32_t add, uint16_t dat);
extern void bsp_flash_write_buff(uint32_t add , uint16_t* buf, uint16_t len);
extern void bsp_flash_read_buff(uint32_t add , uint16_t* buf, uint16_t len);
extern uint16_t bsp_flash_read(uint32_t add);


#endif
